<?php
namespace App\Admin\Controllers\FileModel;
use App\Http\Controllers\Controller;
use Dcat\Admin\FormStep\Form as StepForm;
use App\Models\InputStepForm;
use App\Models\InformationList;
use Dcat\Admin\Form;
use Dcat\Admin\Admin;
use Dcat\Admin\Widgets\Checkbox;
use Dcat\Admin\Widgets\Radio;
use Dcat\Admin\Widgets\Card;
use Dcat\Admin\Layout\Content;
use Illuminate\Http\Request;
use PhpOffice\PhpWord\TemplateProcessor;
use PhpOffice\PhpWord\PhpWord;
use Dcat\Admin\Widgets\Alert;
use Dcat\Admin\Grid;
use Illuminate\Support\Facades\DB;
use Log;
// use Dcat\Admin\Widgets\Form;
class InstallInspectionController extends Controller
{
    //5.1-电除尘器本体安装监查记录
    protected $options = [
        1 => '显示文本框',
        2 => '显示编辑器',
        3 => '显示文件上传',
        4 => '还是显示文本框',
    ];
    // use PreviewCode;
    public function index(Content $content)
    {
        return $content
            // ->body('<div style="margin:5px 0 15px;">'.$this->buildPreviewButton().'</div>')
            ->body($this->form())
            ->header('5.1-电除尘器本体安装监查记录')
            ->description('分步表单');
    }
    protected function form()
{
    Admin::js('/stepform/js/jquery.smartWizard.min.js');
    Admin::css('/stepform/css/step.css');
    return Form::make(new InputStepForm(), function (Form $form) {
            $form->title('电除尘改造信息调查表数据录入');
            $form->action('InstallInspectionstep');
            $form->disableListButton();
            $form->multipleSteps()
                ->remember() 
                ->width('100%')
                ->add('钢支架、下支承座', function (StepForm $step) use ($form) {
                    $info = '<i class="fa fa-exclamation-circle"></i>钢支架，钢支架联接焊缝，按电场数20%';
                    $step->html(Alert::make($info)->info());
                    $step->radio('pa11','焊缝高度按图纸要求')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa11s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa12','焊缝要求饱满、圆滑过渡、成 形好,特别是不得塞圆钢。')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa12s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa13','节点板端头与管撑之间的缝隙 、螺栓孔间隙应进行封堵焊。')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa13s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa14','柱脚的二次浇灌是否按时并规 范')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa14s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa15','地脚螺栓、螺母按图纸要求安 装并焊接')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa15s','不符合位置/数量');
                    })->default(1);
                    $step->textarea('pa11info', '总体质量描述');
                    $step->divider();
                    $info1 = '<i class="fa fa-exclamation-circle"></i>下支架承座检查，按支承座数30％';
                    $step->html(Alert::make($info1)->info());
                    $step->radio('pa16','认真检查各类支座的位置(固定支座、单向支座以及双向支座)应符合图纸要求')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa16s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa17','单向、双向支座是否按照顺序装好滑板(聚四氟乙烯)、底板;以保证电除尘器在热胀冷缩时能自由伸缩不受阻碍')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa17s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa18','活动支座不锈钢板及其下部垫板的焊接必须用不锈钢焊条与底板进行焊接')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa18s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa19','单向、双向支座上的临时限位挡块清除干净')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa19s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa110','固定支座与宽立柱柱脚焊接牢固、焊缝高度符合图纸要求')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa110s','不符合位置/数量');
                    })->default(1);
                    $step->textarea('pa12info', '总体质量描述');
                    
                })
                ->add('灰斗', function ($step) { 
                    $infopa21 = '<i class="fa fa-exclamation-circle"></i>灰斗安装检查，按灰斗数20％';
                    $step->html(Alert::make($infopa21)->info());
                    $step->radio('pa21','灰斗挂板、加强角钢按图纸位 置安装正确，焊缝符合设计要求')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa21s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa22','在灰斗上口与承压件、下端板 或下圈梁等焊缝要求饱满、圆滑过 渡、密封良好。')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa22s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa23','灰斗外壁的角钢加强筋要互相搭接，搭接处要焊实，以免影响强度。')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa23s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa24','焊缝严密，灰斗内壁的疤痕必须用砂轮机打磨光')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa24s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa25','灰斗内壁四角过渡板两侧焊缝必须用砂轮机打磨平滑，过渡板上端封口应与灰斗上口平齐')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa25s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa26','灰斗管撑焊缝符合设计要求， 严禁塞焊、虚焊、假焊')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa26s','不符合位置/数量');
                    })->default(1);
                    $infopa22 = '<i class="fa fa-exclamation-circle"></i>阻流板、仓壁振 动器、出灰口、 手动振打砧、人 孔门、料位计、 气化板，按灰斗数20％';
                    $step->html(Alert::make($infopa22)->info());
                    $step->radio('pa27','阻流板下端与出灰口距离符合图纸要求，仓壁振动器基座、手动振打砧、料位计座装配位置正确')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa27s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa28','料位计挡灰角钢按图纸要求安装，焊接牢固')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa28s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa29','灰斗温度计座按图纸位置安装正确，导热铁焊接牢固')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa29s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa210','气化板螺栓是否拧紧')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa210s','不符合位置/数量');
                    })->default(1);
                    $step->divider();
                    $step->textarea('pa2info', '总体质量描述');
                })
                ->add('壳体',function ($step){
                    $infopa31 = '<i class="fa fa-exclamation-circle"></i>壳体、顶梁、墙板等的检查,按电场 数20%';
                    $step->html(Alert::make($infopa31)->info());
                    $step->radio('pa41','中隔墙管撑与节点板的焊接是 否符合图纸要求')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa41s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa42','中部承压件二端焊接是否符合图纸要求，特别是进出口位置承压件二端焊接是否符合图纸要求')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa42s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa43','壳体柱脚支撑管安装和焊接是否符合要求')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa43s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa44','检查顶梁与立柱、宽立柱、上端板的焊接是否符合图纸要求')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa44s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa45','检查各顶梁在电场宽度方向上的水平度')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa45s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa46','墙板与立柱、宽立柱联接处的焊缝必须符合图纸要求')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa46s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa47','张紧杆及斜拉筋紧实、焊接牢固')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa47s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa48','检查立柱、 宽立柱的铅垂度，立柱、宽立柱的铅垂度应≤10mm')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa48s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa49','上部阻流板是否按图纸要求安装')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa49s','不符合位置/数量');
                    })->default(1);
                    // $step->divider();
                    $step->textarea('pa4info', '总体质量描述');
                })->add('阳极系统',function ($step){
                    $infopa31 = '<i class="fa fa-exclamation-circle"></i>侧部振打阳极系统 (极板排、振 打机构)，按灰电场数20％';
                    $step->html(Alert::make($infopa31)->info());
                    $step->radio('pa51','阳极振打传动装置中，传动轴是靠联轴套与弹性圆柱销进行装配联接，安装就位后必须将联轴套与传动轴焊接')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa51s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa52','按图要求检查阳极振打轴承支座与底部支架平台之间是否牢固焊接')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa52s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa53','检查减速电机是否加润滑油并通电检查振打机构的转动情况，所有振打锤运转既平稳又灵活、冷态下振打锤打击点位置是否正确，应无卡涩等现象')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa53s','不符合位置/数量');
                    })->default(1);
                    $infopa32 = '<i class="fa fa-exclamation-circle"></i>侧部振打阳极系统 (极板排、振 打机构)，按灰电场数20％';
                    $step->html(Alert::make($infopa32)->info());
                    $step->text('pa54','极板吊装过程导致塑性变形的数量');
                    $step->radio('pa55','极板的竖吊点是否上提，极板二端吊点是否等高')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa55s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa56','检查阳极振打砧梁、传力板与阳极板排振打砧板的焊缝是否符合图纸要求')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa56s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa57','悬挂销板与固定板边沿对铅垂直的偏转量为±3.2mm；焊缝符合图纸要求')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa57s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa58','阳极接地线按要求安装到位、焊接牢固')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa58s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa59','阳极板导向槽钢插销安装正确，焊接正确')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa59s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa510','定位耙按设计要求焊接 (两端及每隔三个焊)')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa510s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa511','阳极板、防摆杆上螺栓螺母必须做止转焊接')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa511s','不符合位置/数量');
                    })->default(1);
                    $infopa33 = '<i class="fa fa-exclamation-circle"></i>阳极系统 (极板 排、振打机构)，按灰电场数20％';
                    $step->html(Alert::make($infopa33)->info());
                    $step->radio('pa512','检查侧部阻流板安装位置与阳极板的间隙是否符合图纸要求')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa512s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa513','检查调整杆导向槽钢两端与防摆板、防摆杆的安装位置，要求严格按图施工，保证导向槽钢能上下自由伸缩(伸缩量应不小于50mm)')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa513s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa514','板排平面度达到要求及保证极间距达图纸要求，极板排平面度≤10mm ，极间距是否达图纸±10mm要求')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa514s','不符合位置/数量');
                    })->default(1);
                    $step->divider();
                    $step->textarea('pa5info', '总体质量描述');
                })->add('顶板、保温箱',function ($step){
                    $infopa41 = '<i class="fa fa-exclamation-circle"></i>封板的检查，按灰电场数30％';
                    $step->html(Alert::make($infopa41)->info());
                    $step->radio('pa61','封板就位后，检查封板与上端板、顶梁的焊缝是否符合要求')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa61s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa62','顶板就位后，检查各孔与阴极吊杆中心线、阳极振打砧中心是否符合要求。与阳极振打杆必须保证至少5mm的间隙')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa62s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa63','顶板内壁与顶梁间断焊接符合设计要求')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa63s','不符合位置/数量');
                    })->default(1);
                    $infopa42 = '<i class="fa fa-exclamation-circle"></i>保温箱的安装检查(侧板、顶板、顶板加强筋、竖加强筋、底框角钢、人孔门)，按灰电场数30％';
                    $step->html(Alert::make($infopa42)->info());
                    $step->radio('pa64','检查振打杆与保温箱的孔是否对正')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa64s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa65','检查侧板与顶板的焊缝是否符合要求')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa65s','不符合位置/数量');
                    })->default(1);
                    $step->divider();
                    $step->textarea('pa6info', '总体质量描述');
                })->add('阴极系统',function ($step){
                    $infopa51 = '<i class="fa fa-exclamation-circle"></i>阴极系统(垫板、保温箱、接线盒、电加热器、加热器托架、防摆杆、挡块、振打杆、联接套、锥形绝缘轴、限位块、支承轴套、石棉橡胶垫片、支承法兰、填料抱箍、承压绝缘子、绝缘子支承法兰、石棉橡胶垫圈、吊杆组件、销、阴极吊梁)，按灰电场数20％';
                    $step->html(Alert::make($infopa51)->info());
                    $step->radio('pa71','阴极砧梁、阴极框架焊缝应符合图纸要求，焊缝饱满，圆滑，不得焊穿或漏焊')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa71s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa72','调整阴极框架铅垂度及异极距，异极距偏差为±10mm')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa72s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa73','阴极系统的支承绝缘子、绝缘轴检查，表面不得有裂纹及连续性疤痕')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa73s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa74','绝缘子中心线与吊杆中心线应重合，其同轴度为10mm')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa74s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa75','调整阴极振打杆，保证铅垂，杆端偏离中心位置不大于3mm')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa75s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa76','阴极系统安装完毕后，防摆框架的所有螺栓副应点焊牢固，防止松动脱落')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa76s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa77','同一组支承绝缘子应调整到同一水平面内，其平面度为10mm')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa77s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa78','保温箱与壳体顶板的焊接应注意保证气密性，内侧段焊应符合图纸要求')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa78s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa79','同一电场相邻分区阴极框架上、下横管按图装配，阴极框架间的防扭挡块应按图纸要求布置，螺母必须做止转焊接')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa79s','不符合位置/数量');
                    })->default(1);
                    $step->divider();
                    $step->textarea('pa7info', '总体质量描述');
                })->add('进出口喇叭',function ($step){
                    $infopa61 = '<i class="fa fa-exclamation-circle"></i>进口喇叭的检查。(侧板、烟道接口法兰、顶板、人孔门孔板、底板、外法兰、管撑联接板、振打杆组件、联接块、按管、联接角钢、振打梁、夹板、振打杆、圆钢、温度计座、垫片、吊杆螺栓、承压座、套
                    管、爬手等部件)，按喇叭口数50%且不少于1个喇叭口';
                    $step->html(Alert::make($infopa61)->info());
                    $step->radio('pa81','气流分布板的整体平面度应≤10mm')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa81s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa82','气流分布板的人孔门要紧固良好')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa82s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa83','重点检查管撑各焊缝的焊接质量，进口喇叭与壳体法兰的焊接应贴紧焊，不得有虚焊、塞焊现象，密封良好')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa83s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa84','分布板底边与底板的垂直距离应为150－200mm')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa84s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa85','当进口喇叭为垂直下进风机构时，气流分布板上端与喇叭顶板的间距不大于50mm，且愈小愈好')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa85s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa86','防冲刷角钢按图纸安装到位、焊接牢固')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa86s','不符合位置/数量');
                    })->default(1);
                    $infopa62 = '<i class="fa fa-exclamation-circle"></i>出口喇叭的检查(槽型板排悬挂槽钢、上吊梁、下梁、定块、人孔门、外法兰、顶板、底板、侧板、振打杆组件、接管、联接角钢、管撑、联接板、吊杆螺栓、垫片、承压座、防摆杆、防摆板、温度计座、爬
                    手等)，按喇叭口数50%且不少于1个喇叭口';
                    $step->html(Alert::make($infopa62)->info());
                    $step->radio('pa87','检查各焊缝的外观质量，特别注意检查管撑的焊接质量，出口喇叭与壳体法兰的焊接应贴紧焊，不得有虚焊、塞焊现象，密封良好')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa87s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa88','人孔门的焊接应符合图纸要求，密封性良好')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa88s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa89','检查槽型板排底边与喇叭底板的间隙 ，要求≥150mm。同时检查防摆板及防摆杆的装配应符合图纸要求')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa89s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa810','槽形板位置布置、焊接应符合图纸要求')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa810s','不符合位置/数量');
                    })->default(1);
                    // $step->divider();
                    // $step->textarea('pa8info', '总体质量描述');
                })->add('振打系统与楼梯走道',function ($step){
                    $infopa71 = '<i class="fa fa-exclamation-circle"></i>振打系统，按电场数20%';
                    $step->html(Alert::make($infopa71)->info());
                    $step->radio('pa91','振打锤与振打砧中心水平位置误差±5mm;垂直方向公差±5mm')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa91s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa92','振打轴，直线度为10mm')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa92s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa93','振动大电机转向正确')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa93s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa94','振打轴套与壳体焊缝饱满，无漏气')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa94s','不符合位置/数量');
                    })->default(1);
                    $step->textarea('pa91info', '总体质量描述');
                    $infopa72 = '<i class="fa fa-exclamation-circle"></i>楼梯走道(栏杆、防滑板、框架、支撑、格子板)，楼梯走道的60%';
                    $step->html(Alert::make($infopa72)->info());
                    $step->radio('pa95','按图纸要求安装楼梯走道，并刷防锈漆、面漆')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa95s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa96','支撑与壳体焊接牢固')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa96s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa97','顶部栏杆防滑板间隙是否符合排水要求')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa97s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa98','框架间按图焊接牢固，以形成一个整体')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa98s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa99','栏杆接头处要去焊渣、毛刺，拐角光滑过渡，外形美观')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa99s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa910','楼梯栏杆高度为1200mm，检查是否符合要求')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa910s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa911','框架与支撑(牛腿)之间是否焊接，必须严格按图执行，以确保电除尘器本体设备热胀冷缩时不受影响')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa911s','不符合位置/数量');
                    })->default(1);
                    // $step->textarea('pa92info', '总体质量描述');
                })->add('高压进线系统、顶部起吊系统、烟道导流及监测装置',function ($step){
                    $infopa81 = '<i class="fa fa-exclamation-circle"></i>高压进线系统(导电杆、联接件、盖板、挡垫、护套管支承板、高压穿墙套管、变压器支座)，按电场数的60%';
                    $step->html(Alert::make($infopa81)->info());
                    $step->radio('pa101','整流变压器支座、变压器安装应符合图纸要求')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa101s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa102','安装高压穿墙套管、导电杆、护套管等高压附件，应符合图纸要求')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa102s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa103','高压导线接头焊接是否牢固紧固件装配应符合设计要求')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa103s','不符合位置/数量');
                    })->default(1);
                    $infopa82 = '<i class="fa fa-exclamation-circle"></i>顶部起吊系统(立柱、支撑、电动葫芦)，抽检数量100%';
                    $step->html(Alert::make($infopa82)->info());
                    $step->radio('pa104','起吊系统的安装位置、尺寸应符合图纸要求')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa104s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa105','焊接质量应符合图纸要求')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa105s','不符合位置/数量');
                    })->default(1);
                    $step->radio('pa106','电动葫芦规格、装配应满足设计要求')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa106s','不符合位置/数量');
                    })->default(1);
                    $step->textarea('pa101info', '顶部起吊系统总体质量描述');
                    $infopa83 = '<i class="fa fa-exclamation-circle"></i>进口烟道内导流板，抽检数量100%';
                    $step->html(Alert::make($infopa83)->info());
                    $step->radio('pa107','导流板按设计要求安装')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa107s','不符合位置/数量');
                    })->default(1);
                    $infopa83 = '<i class="fa fa-exclamation-circle"></i>出口烟道浊度仪，抽检数量100%';
                    $step->html(Alert::make($infopa83)->info());
                    $step->radio('pa108','浊度仪检修平台已按设计安装')->options(
                        ['1' => '符合','2' => '不符合']
                    )->when('2',function(StepForm $step){
                        $step->text('pa108s','不符合位置/数量');
                    })->default(1);
                    $step->textarea('pa102info', '烟道导流及监测装置总体质量描述');
                });
        });
    }


    public function step(Request $request){
        $info = $request->all();
        Log::info($info);
        if(empty($info['CURRENT_VALIDATION_STEP'])&&$info['ALL_STEPS']==1){//提交
            
            //实例化 phpword 类
            $PHPWord = new PhpWord();
            //指定事先制作好的模板文件路径
            $templateProcessor = new TemplateProcessor(public_path("filemodel/engineering_table.docx"));
            // $templateProcessor->setValue('projectname', $info['projectname']);
            // $templateProcessor->setValue('guihao', $info['guihao']);
            // $templateProcessor->setValue('sgdw', $info['sgdw']);
            // $templateProcessor->setValue('jcry', $info['jcry']);
            $true = '<w:r><w:rPr><w:rFonts w:hint="eastAsia"/><w:lang w:val="en-US" w:eastAsia="zh-CN"/></w:rPr><w:sym w:font="Wingdings" w:char="00FE"/></w:r>';
            $false = '<w:r><w:rPr><w:rFonts w:hint="eastAsia"/><w:lang w:val="en-US" w:eastAsia="zh-CN"/></w:rPr><w:sym w:font="Wingdings" w:char="00A8"/></w:r>';
            //钢支架 下支承座
            $pa1a = $info['pa11'] == 1?$true:$false;
            $pa1as = $info['pa11'] == 1?$false:$true;
            $pa1ar = $info['pa11s'];
            $templateProcessor->setValue('pa1a1',$pa1a);
            $templateProcessor->setValue('pa1a2',$pa1as);
            $templateProcessor->setValue('pa1ar',$pa1ar);
            $pa1b = $info['pa12'] == 1?$true:$false;
            $pa1bs = $info['pa12'] == 1?$false:$true;
            $pa1br = $info['pa12s'];
            $templateProcessor->setValue('pa1b1',$pa1b);
            $templateProcessor->setValue('pa1b2',$pa1bs);
            $templateProcessor->setValue('pa1br',$pa1br);
            $pa1c = $info['pa13'] == 1?$true:$false;
            $pa1cs = $info['pa13'] == 1?$false:$true;
            $pa1cr = $info['pa13s'];
            $templateProcessor->setValue('pa1c1',$pa1c);
            $templateProcessor->setValue('pa1c2',$pa1cs);
            $templateProcessor->setValue('pa1cr',$pa1cr);
            $pa1d = $info['pa14'] == 1?$true:$false;
            $pa1ds = $info['pa14'] == 1?$false:$true;
            $pa1dr = $info['pa14s'];
            $templateProcessor->setValue('pa1d1',$pa1d);
            $templateProcessor->setValue('pa1d2',$pa1ds);
            $templateProcessor->setValue('pa1dr',$pa1dr);
            $pa1e = $info['pa15'] == 1?$true:$false;
            $pa1es = $info['pa15'] == 1?$false:$true;
            $pa1er = $info['pa15s'];
            $templateProcessor->setValue('pa1e1',$pa1e);
            $templateProcessor->setValue('pa1e2',$pa1es);
            $templateProcessor->setValue('pa1er',$pa1er);
            $pa1f = $info['pa16'] == 1?$true:$false;
            $pa1fs = $info['pa16'] == 1?$false:$true;
            $pa1fr = $info['pa16s'];
            $templateProcessor->setValue('pa1f1',$pa1f);
            $templateProcessor->setValue('pa1f2',$pa1fs);
            $templateProcessor->setValue('pa1fr',$pa1fr);
            $pa1g = $info['pa17'] == 1?$true:$false;
            $pa1gs = $info['pa17'] == 1?$false:$true;
            $pa1gr = $info['pa17s'];
            $templateProcessor->setValue('pa1g1',$pa1g);
            $templateProcessor->setValue('pa1g2',$pa1gs);
            $templateProcessor->setValue('pa1gr',$pa1gr);
            $pa1h = $info['pa18'] == 1?$true:$false;
            $pa1hs = $info['pa18'] == 1?$false:$true;
            $pa1hr = $info['pa18s'];
            $templateProcessor->setValue('pa1h1',$pa1h);
            $templateProcessor->setValue('pa1h2',$pa1hs);
            $templateProcessor->setValue('pa1hr',$pa1hr);
            $pa1i = $info['pa19'] == 1?$true:$false;
            $pa1is = $info['pa19'] == 1?$false:$true;
            $pa1ir = $info['pa19s'];
            $templateProcessor->setValue('pa1i1',$pa1i);
            $templateProcessor->setValue('pa1i2',$pa1is);
            $templateProcessor->setValue('pa1ir',$pa1ir);
            $pa1j = $info['pa110'] == 1?$true:$false;
            $pa1js = $info['pa110'] == 1?$false:$true;
            $pa1jr = $info['pa110s'];
            $templateProcessor->setValue('pa1j1',$pa1j);
            $templateProcessor->setValue('pa1j2',$pa1js);
            $templateProcessor->setValue('pa1jr',$pa1jr);

            $templateProcessor->setValue('pa11info',$info['pa11info']);
            $templateProcessor->setValue('pa12info',$info['pa12info']);
            //灰斗
            $pa2a = $info['pa21'] == 1 ? $true : $false;
            $pa2as = $info['pa21'] == 1 ? $false : $true;
            $pa2ar = $info['pa21s'];
            $templateProcessor->setValue('pa2a1',$pa2a);
            $templateProcessor->setValue('pa2a2',$pa2as);
            $templateProcessor->setValue('pa2ar',$pa2ar);
            $pa2b = $info['pa22'] == 1 ? $true : $false;
            $pa2bs = $info['pa22'] == 1 ? $false : $true;
            $pa2br = $info['pa22s'];
            $templateProcessor->setValue('pa2b1',$pa2b);
            $templateProcessor->setValue('pa2b2',$pa2bs);
            $templateProcessor->setValue('pa2br',$pa2br);
            $pa2c = $info['pa23'] == 1 ? $true : $false;
            $pa2cs = $info['pa23'] == 1 ? $false : $true;
            $pa2cr = $info['pa23s'];
            $templateProcessor->setValue('pa2c1',$pa2c);
            $templateProcessor->setValue('pa2c2',$pa2cs);
            $templateProcessor->setValue('pa2cr',$pa2cr);
            $pa2d = $info['pa24'] == 1 ? $true : $false;
            $pa2ds = $info['pa24'] == 1 ? $false : $true;
            $pa2dr = $info['pa24s'];
            $templateProcessor->setValue('pa2d1',$pa2d);
            $templateProcessor->setValue('pa2d2',$pa2ds);
            $templateProcessor->setValue('pa2dr',$pa2dr);
            $pa2e = $info['pa25'] == 1 ? $true : $false;
            $pa2es = $info['pa25'] == 1 ? $false : $true;
            $pa2er = $info['pa25s'];
            $templateProcessor->setValue('pa2e1',$pa2e);
            $templateProcessor->setValue('pa2e2',$pa2es);
            $templateProcessor->setValue('pa2er',$pa2er);
            $pa2f = $info['pa26'] == 1 ? $true : $false;
            $pa2fs = $info['pa26'] == 1 ? $false : $true;
            $pa2fr = $info['pa26s'];
            $templateProcessor->setValue('pa2f1',$pa2f);
            $templateProcessor->setValue('pa2f2',$pa2fs);
            $templateProcessor->setValue('pa2fr',$pa2fr);
            $pa2g = $info['pa27'] == 1 ? $true : $false;
            $pa2gs = $info['pa27'] == 1 ? $false : $true;
            $pa2gr = $info['pa27s'];
            $templateProcessor->setValue('pa2g1',$pa2g);
            $templateProcessor->setValue('pa2g2',$pa2gs);
            $templateProcessor->setValue('pa2gr',$pa2gr);
            $pa2h = $info['pa28'] == 1 ? $true : $false;
            $pa2hs = $info['pa28'] == 1 ? $false : $true;
            $pa2hr = $info['pa28s'];
            $templateProcessor->setValue('pa2h1',$pa2h);
            $templateProcessor->setValue('pa2h2',$pa2hs);
            $templateProcessor->setValue('pa2hr',$pa2hr);
            $pa2i = $info['pa29'] == 1 ? $true : $false;
            $pa2is = $info['pa29'] == 1 ? $false : $true;
            $pa2ir = $info['pa29s'];
            $templateProcessor->setValue('pa2i1',$pa2i);
            $templateProcessor->setValue('pa2i2',$pa2is);
            $templateProcessor->setValue('pa2ir',$pa2ir);
            $pa2j = $info['pa210'] == 1 ? $true : $false;
            $pa2js = $info['pa210'] == 1 ? $false : $true;
            $pa2jr = $info['pa210s'];
            $templateProcessor->setValue('pa2j1',$pa2j);
            $templateProcessor->setValue('pa2j2',$pa2js);
            $templateProcessor->setValue('pa2jr',$pa2jr);
            $templateProcessor->setValue('pa2info',$info['pa2info']);
            //壳体
            $pa4a = $info['pa41'] == 1 ? $true : $false;
            $pa4as = $info['pa41'] == 1 ? $false : $true;
            $pa4ar = $info['pa41s'];
            $templateProcessor->setValue('pa4a1',$pa4a);
            $templateProcessor->setValue('pa4a2',$pa4as);
            $templateProcessor->setValue('pa4ar',$pa4ar);
            $pa4b = $info['pa42'] == 1 ? $true : $false;
            $pa4bs = $info['pa42'] == 1 ? $false : $true;
            $pa4br = $info['pa42s'];
            $templateProcessor->setValue('pa4b1',$pa4b);
            $templateProcessor->setValue('pa4b2',$pa4bs);
            $templateProcessor->setValue('pa4br',$pa4br);
            $pa4c = $info['pa43'] == 1 ? $true : $false;
            $pa4cs = $info['pa43'] == 1 ? $false : $true;
            $pa4cr = $info['pa43s'];
            $templateProcessor->setValue('pa4c1',$pa4c);
            $templateProcessor->setValue('pa4c2',$pa4cs);
            $templateProcessor->setValue('pa4cr',$pa4cr);
            $pa4d = $info['pa44'] == 1 ? $true : $false;
            $pa4ds = $info['pa44'] == 1 ? $false : $true;
            $pa4dr = $info['pa44s'];
            $templateProcessor->setValue('pa4d1',$pa4d);
            $templateProcessor->setValue('pa4d2',$pa4ds);
            $templateProcessor->setValue('pa4dr',$pa4dr);
            $pa4e = $info['pa45'] == 1 ? $true : $false;
            $pa4es = $info['pa45'] == 1 ? $false : $true;
            $pa4er = $info['pa45s'];
            $templateProcessor->setValue('pa4e1',$pa4e);
            $templateProcessor->setValue('pa4e2',$pa4es);
            $templateProcessor->setValue('pa4er',$pa4er);
            $pa4f = $info['pa46'] == 1 ? $true : $false;
            $pa4fs = $info['pa46'] == 1 ? $false : $true;
            $pa4fr = $info['pa46s'];
            $templateProcessor->setValue('pa4f1',$pa4f);
            $templateProcessor->setValue('pa4f2',$pa4fs);
            $templateProcessor->setValue('pa4fr',$pa4fr);
            $pa4g = $info['pa47'] == 1 ? $true : $false;
            $pa4gs = $info['pa47'] == 1 ? $false : $true;
            $pa4gr = $info['pa47s'];
            $templateProcessor->setValue('pa4g1',$pa4g);
            $templateProcessor->setValue('pa4g2',$pa4gs);
            $templateProcessor->setValue('pa4gr',$pa4gr);
            $pa4h = $info['pa48'] == 1 ? $true : $false;
            $pa4hs = $info['pa48'] == 1 ? $false : $true;
            $pa4hr = $info['pa48s'];
            $templateProcessor->setValue('pa4h1',$pa4h);
            $templateProcessor->setValue('pa4h2',$pa4hs);
            $templateProcessor->setValue('pa4hr',$pa4hr);
            $pa4i = $info['pa49'] == 1 ? $true : $false;
            $pa4is = $info['pa49'] == 1 ? $false : $true;
            $pa4ir = $info['pa49s'];
            $templateProcessor->setValue('pa4i1',$pa4i);
            $templateProcessor->setValue('pa4i2',$pa4is);
            $templateProcessor->setValue('pa4ir',$pa4ir);
            $templateProcessor->setValue('pa4info',$info['pa4info']);
            ;
            //阳极系统
            $pa5a = $info['pa51'] == 1 ? $true : $false;
            $pa5as = $info['pa51'] == 1 ? $false : $true;
            $pa5ar = $info['pa51s'];
            $templateProcessor->setValue('pa5a1',$pa5a);
            $templateProcessor->setValue('pa5a2',$pa5as);
            $templateProcessor->setValue('pa5ar',$pa5ar);
            $pa5b = $info['pa52'] == 1 ? $true : $false;
            $pa5bs = $info['pa52'] == 1 ? $false : $true;
            $pa5br = $info['pa52s'];
            $templateProcessor->setValue('pa5b1',$pa5b);
            $templateProcessor->setValue('pa5b2',$pa5bs);
            $templateProcessor->setValue('pa5br',$pa5br);
            $pa5c = $info['pa53'] == 1 ? $true : $false;
            $pa5cs = $info['pa53'] == 1 ? $false : $true;
            $pa5cr = $info['pa53s'];
            $templateProcessor->setValue('pa5c1',$pa5c);
            $templateProcessor->setValue('pa5c2',$pa5cs);
            $templateProcessor->setValue('pa5cr',$pa5cr);
            // $pa5d = $info['pa54'] == 1 ? $true : $false;
            // $pa5ds = $info['pa54'] == 1 ? $false : $true;
            // $pa5dr = $info['pa54s'];
            // $templateProcessor->setValue('pa5d1',$pa5d);
            // $templateProcessor->setValue('pa5d2',$pa5ds);
            $templateProcessor->setValue('pa5dr',$info['pa54']);
            $pa5e = $info['pa55'] == 1 ? $true : $false;
            $pa5es = $info['pa55'] == 1 ? $false : $true;
            $pa5er = $info['pa55s'];
            $templateProcessor->setValue('pa5e1',$pa5e);
            $templateProcessor->setValue('pa5e2',$pa5es);
            $templateProcessor->setValue('pa5er',$pa5er);
            $pa5f = $info['pa56'] == 1 ? $true : $false;
            $pa5fs = $info['pa56'] == 1 ? $false : $true;
            $pa5fr = $info['pa56s'];
            $templateProcessor->setValue('pa5f1',$pa5f);
            $templateProcessor->setValue('pa5f2',$pa5fs);
            $templateProcessor->setValue('pa5fr',$pa5fr);
            $pa5g = $info['pa57'] == 1 ? $true : $false;
            $pa5gs = $info['pa57'] == 1 ? $false : $true;
            $pa5gr = $info['pa57s'];
            $templateProcessor->setValue('pa5g1',$pa5g);
            $templateProcessor->setValue('pa5g2',$pa5gs);
            $templateProcessor->setValue('pa5gr',$pa5gr);
            $pa5h = $info['pa58'] == 1 ? $true : $false;
            $pa5hs = $info['pa58'] == 1 ? $false : $true;
            $pa5hr = $info['pa58s'];
            $templateProcessor->setValue('pa5h1',$pa5h);
            $templateProcessor->setValue('pa5h2',$pa5hs);
            $templateProcessor->setValue('pa5hr',$pa5hr);
            $pa5i = $info['pa59'] == 1 ? $true : $false;
            $pa5is = $info['pa59'] == 1 ? $false : $true;
            $pa5ir = $info['pa59s'];
            $templateProcessor->setValue('pa5i1',$pa5i);
            $templateProcessor->setValue('pa5i2',$pa5is);
            $templateProcessor->setValue('pa5ir',$pa5ir);
            $pa5j = $info['pa510'] == 1 ? $true : $false;
            $pa5js = $info['pa510'] == 1 ? $false : $true;
            $pa5jr = $info['pa510s'];
            $templateProcessor->setValue('pa5j1',$pa5j);
            $templateProcessor->setValue('pa5j2',$pa5js);
            $templateProcessor->setValue('pa5jr',$pa5jr);
            $pa5k = $info['pa511'] == 1 ? $true : $false;
            $pa5ks = $info['pa511'] == 1 ? $false : $true;
            $pa5kr = $info['pa511s'];
            $templateProcessor->setValue('pa5k1',$pa5k);
            $templateProcessor->setValue('pa5k2',$pa5ks);
            $templateProcessor->setValue('pa5kr',$pa5kr);
            $pa5l = $info['pa512'] == 1 ? $true : $false;
            $pa5ls = $info['pa512'] == 1 ? $false : $true;
            $pa5lr = $info['pa512s'];
            $templateProcessor->setValue('pa5l1',$pa5l);
            $templateProcessor->setValue('pa5l2',$pa5ls);
            $templateProcessor->setValue('pa5lr',$pa5lr);
            $pa5m = $info['pa513'] == 1 ? $true : $false;
            $pa5ms = $info['pa513'] == 1 ? $false : $true;
            $pa5mr = $info['pa513s'];
            $templateProcessor->setValue('pa5m1',$pa5m);
            $templateProcessor->setValue('pa5m2',$pa5ms);
            $templateProcessor->setValue('pa5mr',$pa5mr);
            $pa5n = $info['pa514'] == 1 ? $true : $false;
            $pa5ns = $info['pa514'] == 1 ? $false : $true;
            $pa5nr = $info['pa514s'];
            $templateProcessor->setValue('pa5n1',$pa5n);
            $templateProcessor->setValue('pa5n2',$pa5ns);
            $templateProcessor->setValue('pa5nr',$pa5nr);
            $templateProcessor->setValue('pa5info',$info['pa5info']);
            //顶板 保温箱
            $pa6a = $info['pa61'] == 1 ? $true : $false;
            $pa6as = $info['pa61'] == 1 ? $false : $true;
            $pa6ar = $info['pa61s'];
            $templateProcessor->setValue('pa6a1',$pa6a);
            $templateProcessor->setValue('pa6a2',$pa6as);
            $templateProcessor->setValue('pa6ar',$pa6ar);
            $pa6b = $info['pa62'] == 1 ? $true : $false;
            $pa6bs = $info['pa62'] == 1 ? $false : $true;
            $pa6br = $info['pa62s'];
            $templateProcessor->setValue('pa6b1',$pa6b);
            $templateProcessor->setValue('pa6b2',$pa6bs);
            $templateProcessor->setValue('pa6br',$pa6br);
            $pa6c = $info['pa63'] == 1 ? $true : $false;
            $pa6cs = $info['pa63'] == 1 ? $false : $true;
            $pa6cr = $info['pa63s'];
            $templateProcessor->setValue('pa6c1',$pa6c);
            $templateProcessor->setValue('pa6c2',$pa6cs);
            $templateProcessor->setValue('pa6cr',$pa6cr);
            $pa6d = $info['pa64'] == 1 ? $true : $false;
            $pa6ds = $info['pa64'] == 1 ? $false : $true;
            $pa6dr = $info['pa64s'];
            $templateProcessor->setValue('pa6d1',$pa6d);
            $templateProcessor->setValue('pa6d2',$pa6ds);
            $templateProcessor->setValue('pa6dr',$pa6dr);
            $pa6e = $info['pa65'] == 1 ? $true : $false;
            $pa6es = $info['pa65'] == 1 ? $false : $true;
            $pa6er = $info['pa65s'];
            $templateProcessor->setValue('pa6e1',$pa6e);
            $templateProcessor->setValue('pa6e2',$pa6es);
            $templateProcessor->setValue('pa6er',$pa6er);
            $templateProcessor->setValue('pa6info',$info['pa6info']);
            //阴极系统
            $pa7a = $info['pa71'] == 1 ? $true : $false;
            $pa7as = $info['pa71'] == 1 ? $false : $true;
            $pa7ar = $info['pa71s'];
            $templateProcessor->setValue('pa7a1',$pa7a);
            $templateProcessor->setValue('pa7a2',$pa7as);
            $templateProcessor->setValue('pa7ar',$pa7ar);
            $pa7b = $info['pa72'] == 1 ? $true : $false;
            $pa7bs = $info['pa72'] == 1 ? $false : $true;
            $pa7br = $info['pa72s'];
            $templateProcessor->setValue('pa7b1',$pa7b);
            $templateProcessor->setValue('pa7b2',$pa7bs);
            $templateProcessor->setValue('pa7br',$pa7br);
            $pa7c = $info['pa73'] == 1 ? $true : $false;
            $pa7cs = $info['pa73'] == 1 ? $false : $true;
            $pa7cr = $info['pa73s'];
            $templateProcessor->setValue('pa7c1',$pa7c);
            $templateProcessor->setValue('pa7c2',$pa7cs);
            $templateProcessor->setValue('pa7cr',$pa7cr);
            $pa7d = $info['pa74'] == 1 ? $true : $false;
            $pa7ds = $info['pa74'] == 1 ? $false : $true;
            $pa7dr = $info['pa74s'];
            $templateProcessor->setValue('pa7d1',$pa7d);
            $templateProcessor->setValue('pa7d2',$pa7ds);
            $templateProcessor->setValue('pa7dr',$pa7dr);
            $pa7e = $info['pa75'] == 1 ? $true : $false;
            $pa7es = $info['pa75'] == 1 ? $false : $true;
            $pa7er = $info['pa75s'];
            $templateProcessor->setValue('pa7e1',$pa7e);
            $templateProcessor->setValue('pa7e2',$pa7es);
            $templateProcessor->setValue('pa7er',$pa7er);
            $pa7f = $info['pa76'] == 1 ? $true : $false;
            $pa7fs = $info['pa76'] == 1 ? $false : $true;
            $pa7fr = $info['pa76s'];
            $templateProcessor->setValue('pa7f1',$pa7f);
            $templateProcessor->setValue('pa7f2',$pa7fs);
            $templateProcessor->setValue('pa7fr',$pa7fr);
            $pa7g = $info['pa77'] == 1 ? $true : $false;
            $pa7gs = $info['pa77'] == 1 ? $false : $true;
            $pa7gr = $info['pa77s'];
            $templateProcessor->setValue('pa7g1',$pa7g);
            $templateProcessor->setValue('pa7g2',$pa7gs);
            $templateProcessor->setValue('pa7gr',$pa7gr);
            $pa7h = $info['pa78'] == 1 ? $true : $false;
            $pa7hs = $info['pa78'] == 1 ? $false : $true;
            $pa7hr = $info['pa78s'];
            $templateProcessor->setValue('pa7h1',$pa7h);
            $templateProcessor->setValue('pa7h2',$pa7hs);
            $templateProcessor->setValue('pa7hr',$pa7hr);
            $pa7i = $info['pa79'] == 1 ? $true : $false;
            $pa7is = $info['pa79'] == 1 ? $false : $true;
            $pa7ir = $info['pa79s'];
            $templateProcessor->setValue('pa7i1',$pa7i);
            $templateProcessor->setValue('pa7i2',$pa7is);
            $templateProcessor->setValue('pa7ir',$pa7ir);
            
            $templateProcessor->setValue('pa7info',$info['pa7info']);
            //进出口喇叭
            $pa8a = $info['pa81'] == 1 ? $true : $false;
            $pa8as = $info['pa81'] == 1 ? $false : $true;
            $pa8ar = $info['pa81s'];
            $templateProcessor->setValue('pa8a1',$pa8a);
            $templateProcessor->setValue('pa8a2',$pa8as);
            $templateProcessor->setValue('pa8ar',$pa8ar);
            $pa8b = $info['pa82'] == 1 ? $true : $false;
            $pa8bs = $info['pa82'] == 1 ? $false : $true;
            $pa8br = $info['pa82s'];
            $templateProcessor->setValue('pa8b1',$pa8b);
            $templateProcessor->setValue('pa8b2',$pa8bs);
            $templateProcessor->setValue('pa8br',$pa8br);
            $pa8c = $info['pa83'] == 1 ? $true : $false;
            $pa8cs = $info['pa83'] == 1 ? $false : $true;
            $pa8cr = $info['pa83s'];
            $templateProcessor->setValue('pa8c1',$pa8c);
            $templateProcessor->setValue('pa8c2',$pa8cs);
            $templateProcessor->setValue('pa8cr',$pa8cr);
            $pa8d = $info['pa84'] == 1 ? $true : $false;
            $pa8ds = $info['pa84'] == 1 ? $false : $true;
            $pa8dr = $info['pa84s'];
            $templateProcessor->setValue('pa8d1',$pa8d);
            $templateProcessor->setValue('pa8d2',$pa8ds);
            $templateProcessor->setValue('pa8dr',$pa8dr);
            $pa8e = $info['pa85'] == 1 ? $true : $false;
            $pa8es = $info['pa85'] == 1 ? $false : $true;
            $pa8er = $info['pa85s'];
            $templateProcessor->setValue('pa8e1',$pa8e);
            $templateProcessor->setValue('pa8e2',$pa8es);
            $templateProcessor->setValue('pa8er',$pa8er);
            $pa8f = $info['pa86'] == 1 ? $true : $false;
            $pa8fs = $info['pa86'] == 1 ? $false : $true;
            $pa8fr = $info['pa86s'];
            $templateProcessor->setValue('pa8f1',$pa8f);
            $templateProcessor->setValue('pa8f2',$pa8fs);
            $templateProcessor->setValue('pa8fr',$pa8fr);
            $pa8g = $info['pa87'] == 1 ? $true : $false;
            $pa8gs = $info['pa87'] == 1 ? $false : $true;
            $pa8gr = $info['pa87s'];
            $templateProcessor->setValue('pa8g1',$pa8g);
            $templateProcessor->setValue('pa8g2',$pa8gs);
            $templateProcessor->setValue('pa8gr',$pa8gr);
            $pa8h = $info['pa88'] == 1 ? $true : $false;
            $pa8hs = $info['pa88'] == 1 ? $false : $true;
            $pa8hr = $info['pa88s'];
            $templateProcessor->setValue('pa8h1',$pa8h);
            $templateProcessor->setValue('pa8h2',$pa8hs);
            $templateProcessor->setValue('pa8hr',$pa8hr);
            $pa8i = $info['pa89'] == 1 ? $true : $false;
            $pa8is = $info['pa89'] == 1 ? $false : $true;
            $pa8ir = $info['pa89s'];
            $templateProcessor->setValue('pa8i1',$pa8i);
            $templateProcessor->setValue('pa8i2',$pa8is);
            $templateProcessor->setValue('pa8ir',$pa8ir);
            $pa8j = $info['pa810'] == 1 ? $true : $false;
            $pa8js = $info['pa810'] == 1 ? $false : $true;
            $pa8jr = $info['pa810s'];
            $templateProcessor->setValue('pa8j1',$pa8j);
            $templateProcessor->setValue('pa8j2',$pa8js);
            $templateProcessor->setValue('pa8jr',$pa8jr);
            // $templateProcessor->setValue('pa8info',$info['pa8info']);
            
            //振打系统与楼梯走道
            $pa9a = $info['pa91'] == 1 ? $true : $false;
            $pa9as = $info['pa91'] == 1 ? $false : $true;
            $pa9ar = $info['pa91s'];
            $templateProcessor->setValue('pa9a1',$pa9a);
            $templateProcessor->setValue('pa9a2',$pa9as);
            $templateProcessor->setValue('pa9ar',$pa9ar);
            $pa9b = $info['pa92'] == 1 ? $true : $false;
            $pa9bs = $info['pa92'] == 1 ? $false : $true;
            $pa9br = $info['pa92s'];
            $templateProcessor->setValue('pa9b1',$pa9b);
            $templateProcessor->setValue('pa9b2',$pa9bs);
            $templateProcessor->setValue('pa9br',$pa9br);
            $pa9c = $info['pa93'] == 1 ? $true : $false;
            $pa9cs = $info['pa93'] == 1 ? $false : $true;
            $pa9cr = $info['pa93s'];
            $templateProcessor->setValue('pa9c1',$pa9c);
            $templateProcessor->setValue('pa9c2',$pa9cs);
            $templateProcessor->setValue('pa9cr',$pa9cr);
            $pa9d = $info['pa94'] == 1 ? $true : $false;
            $pa9ds = $info['pa94'] == 1 ? $false : $true;
            $pa9dr = $info['pa94s'];
            $templateProcessor->setValue('pa9d1',$pa9d);
            $templateProcessor->setValue('pa9d2',$pa9ds);
            $templateProcessor->setValue('pa9dr',$pa9dr);
            $pa9e = $info['pa95'] == 1 ? $true : $false;
            $pa9es = $info['pa95'] == 1 ? $false : $true;
            $pa9er = $info['pa95s'];
            $templateProcessor->setValue('pa9e1',$pa9e);
            $templateProcessor->setValue('pa9e2',$pa9es);
            $templateProcessor->setValue('pa9er',$pa9er);
            $pa9f = $info['pa96'] == 1 ? $true : $false;
            $pa9fs = $info['pa96'] == 1 ? $false : $true;
            $pa9fr = $info['pa96s'];
            $templateProcessor->setValue('pa9f1',$pa9f);
            $templateProcessor->setValue('pa9f2',$pa9fs);
            $templateProcessor->setValue('pa9fr',$pa9fr);
            $pa9g = $info['pa97'] == 1 ? $true : $false;
            $pa9gs = $info['pa97'] == 1 ? $false : $true;
            $pa9gr = $info['pa97s'];
            $templateProcessor->setValue('pa9g1',$pa9g);
            $templateProcessor->setValue('pa9g2',$pa9gs);
            $templateProcessor->setValue('pa9gr',$pa9gr);
            $pa9h = $info['pa98'] == 1 ? $true : $false;
            $pa9hs = $info['pa98'] == 1 ? $false : $true;
            $pa9hr = $info['pa98s'];
            $templateProcessor->setValue('pa9h1',$pa9h);
            $templateProcessor->setValue('pa9h2',$pa9hs);
            $templateProcessor->setValue('pa9hr',$pa9hr);
            $pa9i = $info['pa99'] == 1 ? $true : $false;
            $pa9is = $info['pa99'] == 1 ? $false : $true;
            $pa9ir = $info['pa99s'];
            $templateProcessor->setValue('pa9i1',$pa9i);
            $templateProcessor->setValue('pa9i2',$pa9is);
            $templateProcessor->setValue('pa9ir',$pa9ir);
            $pa9j = $info['pa910'] == 1 ? $true : $false;
            $pa9js = $info['pa910'] == 1 ? $false : $true;
            $pa9jr = $info['pa910s'];
            $templateProcessor->setValue('pa9j1',$pa9j);
            $templateProcessor->setValue('pa9j2',$pa9js);
            $templateProcessor->setValue('pa9jr',$pa9jr);
            $pa9k = $info['pa911'] == 1 ? $true : $false;
            $pa9ks = $info['pa911'] == 1 ? $false : $true;
            $pa9kr = $info['pa911s'];
            $templateProcessor->setValue('pa9k1',$pa9k);
            $templateProcessor->setValue('pa9k2',$pa9ks);
            $templateProcessor->setValue('pa9kr',$pa9kr);
            $templateProcessor->setValue('pa91info',$info['pa91info']);

            //高压进线系统
            $pa10a = $info['pa101'] == 1 ? $true : $false;
            $pa10as = $info['pa101'] == 1 ? $false : $true;
            $pa10ar = $info['pa101s'];
            $templateProcessor->setValue('pa10a1',$pa10a);
            $templateProcessor->setValue('pa10a2',$pa10as);
            $templateProcessor->setValue('pa10ar',$pa10ar);
            $pa10b = $info['pa102'] == 1 ? $true : $false;
            $pa10bs = $info['pa102'] == 1 ? $false : $true;
            $pa10br = $info['pa102s'];
            $templateProcessor->setValue('pa10b1',$pa10b);
            $templateProcessor->setValue('pa10b2',$pa10bs);
            $templateProcessor->setValue('pa10br',$pa10br);
            $pa10c = $info['pa103'] == 1 ? $true : $false;
            $pa10cs = $info['pa103'] == 1 ? $false : $true;
            $pa10cr = $info['pa103s'];
            $templateProcessor->setValue('pa10c1',$pa10c);
            $templateProcessor->setValue('pa10c2',$pa10cs);
            $templateProcessor->setValue('pa10cr',$pa10cr);
            $pa10d = $info['pa104'] == 1 ? $true : $false;
            $pa10ds = $info['pa104'] == 1 ? $false : $true;
            $pa10dr = $info['pa104s'];
            $templateProcessor->setValue('pa10d1',$pa10d);
            $templateProcessor->setValue('pa10d2',$pa10ds);
            $templateProcessor->setValue('pa10dr',$pa10dr);
            $pa10e = $info['pa105'] == 1 ? $true : $false;
            $pa10es = $info['pa105'] == 1 ? $false : $true;
            $pa10er = $info['pa105s'];
            $templateProcessor->setValue('pa10e1',$pa10e);
            $templateProcessor->setValue('pa10e2',$pa10es);
            $templateProcessor->setValue('pa10er',$pa10er);
            $pa10f = $info['pa106'] == 1 ? $true : $false;
            $pa10fs = $info['pa106'] == 1 ? $false : $true;
            $pa10fr = $info['pa106s'];
            $templateProcessor->setValue('pa10f1',$pa10f);
            $templateProcessor->setValue('pa10f2',$pa10fs);
            $templateProcessor->setValue('pa10fr',$pa10fr);
            $pa10g = $info['pa107'] == 1 ? $true : $false;
            $pa10gs = $info['pa107'] == 1 ? $false : $true;
            $pa10gr = $info['pa107s'];
            $templateProcessor->setValue('pa10g1',$pa10g);
            $templateProcessor->setValue('pa10g2',$pa10gs);
            $templateProcessor->setValue('pa10gr',$pa10gr);
            $pa10h = $info['pa108'] == 1 ? $true : $false;
            $pa10hs = $info['pa108'] == 1 ? $false : $true;
            $pa10hr = $info['pa108s'];
            $templateProcessor->setValue('pa10h1',$pa10h);
            $templateProcessor->setValue('pa10h2',$pa10hs);
            $templateProcessor->setValue('pa10hr',$pa10hr);
            $templateProcessor->setValue('pa101info',$info['pa101info']);
            $templateProcessor->setValue('pa102info',$info['pa102info']);

            

            
            unset($info['_file_']);
            unset($info['CURRENT_VALIDATION_STEP']);
            unset($info['ALL_STEPS']);
            unset($info['_token']);
            $info['projectname'] = '电除尘器本体安装监查记录';
            $data['admin_id'] = Admin::user()->id;
            $data['name'] = $info['projectname'].date('Y-m-d H:i');
            $data['data'] = $info;
            // $data['content'] = json_encode($info);
            // $insertData['content'] = json_encode($data);
            $insertData['name'] = $data['name'];
            $insertData['type'] = 5;
            $insertData['admin_id'] = Admin::user()->id;
            $insertData['created_at'] = date('Y-m-d H:i:s');
            $templateProcessor->saveAs(public_path('filemodellist/'.$data['name'].".docx"));
            InformationList::insert($insertData);
            return $this->form()->saving(function (Form $form) {
                // 清空缓存
                $form->multipleSteps()->flushStash();
                // 拦截保存操作
                return response(
                    $form->multipleSteps()
                        ->done()
                        ->render()
                );
            })->store();
        }
    }

    /**
     * 保存
     *
     * @return \Symfony\Component\HttpFoundation\Response
     */
    public function store(Request $requset)
    {
        return $this->form()->saving(function (Form $form) {
            
            // 清空缓存
            $form->multipleSteps()->flushStash();
            // 拦截保存操作
            return response(
                $form->multipleSteps()
                    ->done()
                    ->render()
            );
        })->store();
    }
    public function list($id,Content $content){
        return $content
            ->header('表格列表')
            ->description()
            ->body($this->grid($id));
    }
    protected function grid($typeid)
    {
        return new Grid(InformationList::where(['admin_id'=>Admin::user()->id,'type'=>$typeid]), function (Grid $grid) {
            $grid->showActions();
            $grid->disableDeleteButton();
            $grid->disableQuickEditButton();
            $grid->disableViewButton();
            $grid->disableCreateButton();
            $grid->disableEditButton();
            $grid->fixColumns(2);
            
            $grid->column('id', 'ID');
            $grid->column('name', '名称');
            $grid->column('type','类型')->display(function($type) {
                return Db::table('xfy_info_model')->where(['id'=>$type])->value('name');;
            });
            $grid->actions(function (Grid\Displayers\Actions $actions) {
                $id = $actions->getKey();
                $edit_url = admin_base_path('downloadfile/'.$id);
                $actions->append("<a href='$edit_url'>下载</a>");
            });
        });
    }
}